package com.cosc716.restaurant.domain.collections;

import java.util.ArrayList;
import com.cosc716.restaurant.domain.CustomerGroup;


public class WaitingQueue {
	
	private ArrayList<CustomerGroup> customers;
	
	public WaitingQueue() {
		customers = new ArrayList<CustomerGroup>();
	}
	
	public boolean addCustomerGroup(CustomerGroup group) {
		if (customers.add(group)) {
			return true;
		}
		return false;
	}
	
	public boolean removeCustomerGroup(CustomerGroup group) {
		if (customers.remove(group)) {
			return true;
		}
		return false;
	}
	
	public ArrayList<CustomerGroup> getCustomers() {
		return customers;
	}
	
	public void clearCustomers() {
		this.customers.clear();
	}
	
	public static WaitingQueueIterator getQueueIterator(WaitingQueue customers) {
		return new WaitingQueueIterator(customers);
	}
	
	public WaitingQueueIterator getQueueIterator() {
		return getQueueIterator(this);
	}
}


